package com.jsbs.iam.ident.service;

import com.jsbs.iam.common.core.dto.Result;
import com.jsbs.iam.ident.auth.SessionInfo;
import com.jsbs.iam.ident.dto.IamTokenInfoDto;
import com.jsbs.iam.ident.dto.IdentAdminUserRoleVo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * @ClassName: SessionService
 * @Author: junwc
 * @Date: 2022/12/26 11:18
 * @Description:
 */
public interface SessionService {

    /**
     * 功能描述：创建会话
     * @param response
     * @param sessionInfo
     */
    void createSession(HttpServletRequest request, HttpServletResponse response, SessionInfo sessionInfo,
                       List<IdentAdminUserRoleVo> adminUserRoleVoList,
                       String applyUrl, String userType) throws UnsupportedEncodingException;

    /**
     * 功能描述：统一会话认证
     * @param tokenInfo
     * @return
     */
    Result validateSession (IamTokenInfoDto tokenInfo);

    /**
     * 功能描述：根据token查找用户信息
     * @param tokenInfo
     * @return
     */
    Result<SessionInfo> querySessionInfo (HttpServletRequest request,IamTokenInfoDto tokenInfo);
}
